package Boundry;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import java.awt.Font;
import java.awt.Color;
import javax.swing.ImageIcon;
import javax.swing.JButton;

import Boundry.GenericTools.IPanelOperation;
import Boundry.GenericTools.InputPanel;
import Controllers.GenericToolsForController.WorkerRolls;

public class AddNewEmployeGUI extends InputPanel implements IPanelOperation {
	private JLabel lblImage;
	private JTextField textFieldID;
	private JComboBox comboBoxPos;
	private JComboBox comboBoxUserDetails;
	
	
	public void setTextTotextFieldID(String id){
		textFieldID.setText(id);
	}
	public JLabel getLblImage() {
		return lblImage;
	}
	public void setLblImage(JLabel lblImage) {
		this.lblImage = lblImage;
	}
	public JTextField getTextFieldID() {
		return textFieldID;
	}
	public void setTextFieldID(JTextField textFieldID) {
		this.textFieldID = textFieldID;
	}
	public JComboBox getComboBoxPos() {
		return comboBoxPos;
	}
	public void addItemToComboBoxPos(Object item) {
		this.comboBoxPos.addItem(item);
	}
	public void addItemTocomboBoxUserDetails(Object item) {
		this.comboBoxUserDetails.addItem(item);
	}
	
	
	public static void main(String[] args){
		JFrame frame = new JFrame();
		
		frame.revalidate();
		frame.repaint();
		frame.setVisible(true);
		frame.getContentPane().add(new AddNewEmployeGUI());
		//frame.setSize(400, 400);
	}
	/**
	 * Create the panel.
	 */
	public AddNewEmployeGUI() {
		//mainPanel.setBounds(0, 0, 896, 378);
		super();
		initilize();
	}
	
	private void initilize()
	{
		
		setLayout(null);
		
		JLabel lblFirstName = new JLabel("User Details:");
		lblFirstName.setBounds(244, 127, 91, 14);
		mainPanel.add(lblFirstName);
		
		JLabel lblPosition = new JLabel("Position:");
		lblPosition.setBounds(265, 183, 64, 14);
		mainPanel.add(lblPosition);
		
		comboBoxPos = new JComboBox();
		comboBoxPos.setBounds(329, 180, 139, 20);
		mainPanel.add(comboBoxPos);
		
		lblImage = new JLabel("");
		lblImage.setIcon(new ImageIcon(AddNewEmployeGUI.class.getResource("/GUI/Image/6_social_person.png")));
		lblImage.setBackground(Color.LIGHT_GRAY);
		lblImage.setBounds(223, 57, 32, 38);
		mainPanel.add(lblImage);
		
		textFieldID = new JTextField();
		textFieldID.setEditable(false);
		textFieldID.setEnabled(false);
		textFieldID.setBounds(329, 75, 139, 20);
		mainPanel.add(textFieldID);
		textFieldID.setColumns(10);
		
		JLabel lblUserId = new JLabel("User ID:");
		lblUserId.setBounds(265, 78, 65, 14);
		mainPanel.add(lblUserId);
		
		comboBoxUserDetails = new JComboBox();
		comboBoxUserDetails.setBounds(329, 124, 139, 20);
		mainPanel.add(comboBoxUserDetails);
		
		
		comboBoxPos.addItem(""+ WorkerRolls.ICM_MANGER +"-"+ WorkerRolls.ICM_MANGER.getText());
		comboBoxPos.addItem(""+ WorkerRolls.IE +"-"+ WorkerRolls.IE.getText());
		comboBoxPos.addItem(""+ WorkerRolls.ADMINISTATION +"-"+ WorkerRolls.ADMINISTATION.getText());
		
		
		
	}
	public JComboBox getComboBoxUserDetails() {
		return comboBoxUserDetails;
	}
	public void setComboBoxUserDetails(JComboBox comboBoxUserDetails) {
		this.comboBoxUserDetails = comboBoxUserDetails;
	}
	@Override
	public String apHelpButton() {
     		return "Here the ICM Manager manually add a worker to the database";
	}
	@Override
	public String setTitle() {
 		return "Insert new Worker";
	}
}
